from django.contrib.auth.models import AbstractUser
from django.db import models

class CustomUser(AbstractUser):
    avatar = models.ImageField(upload_to='avatars/', null=True, blank=True)
    bio = models.TextField(max_length=500, blank=True)  # 个人简介
    contact_info = models.CharField(max_length=100, blank=True)  # 联系方式
    birthday = models.DateField(null=True, blank=True)  # 生日
    gender = models.CharField(max_length=10, choices=[('male', '男'), ('female', '女'), ('other', '其他')],
                              blank=True)  # 性别
    address = models.CharField(max_length=255, blank=True)  # 地址
    social_links = models.JSONField(null=True, blank=True)  # 社交媒体链接
    website = models.URLField(max_length=200, blank=True)  # 个人网站
    phone_number = models.CharField(max_length=15, blank=True)  # 电话号码

    def __str__(self):
        return self.username
